package edu.ucla.whi.wanda;

import java.util.LinkedList;
import java.util.List;

import org.restlet.ext.wadl.ParameterInfo;
import org.restlet.ext.wadl.ParameterStyle;

public class SensorNewResource extends  BaseNewResource {
	public static final String path = "/sensors/add";
	public static final String description = "Add a new sensosr";
	public static final String outputParamName = "Sensor";

	
	public SensorNewResource() {
		super(SENSORS_DOMAIN);
		
		initDescribe(path, description, outputParamName);
	}

	@Override
	protected List<ParameterInfo> postParams() {
		List<ParameterInfo> params = super.postParams();
		params.addAll(newParams());
		return params;
	}
	
	public static List<ParameterInfo> newParams() {
	List<ParameterInfo> params = new LinkedList<ParameterInfo>();
		
		// required
		params.add(new ParameterInfo("Type", true, "xsd:string", ParameterStyle.QUERY, 
				"Sensor's type"));
		params.add(new ParameterInfo("Unit", true, "xsd:string", ParameterStyle.QUERY, 
				"Sensor's unit"));
		
		// optional
		params.add(new ParameterInfo("Model", false, "xsd:string", ParameterStyle.QUERY, 
				"Sensor's model number"));
		params.add(new ParameterInfo("Manufacturer", false, "xsd:string", ParameterStyle.QUERY, 
				"Sensor's manufacturer"));
		params.add(new ParameterInfo("Spec", false, "xsd:string", ParameterStyle.QUERY, 
				"Sensor's spec"));
		
		return params;
	}
}